package exception;

public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("程序开始");
        try{
            String str1 = "null";
            String str2 = null;
            System.out.println(str1.length());
            System.out.println(str1.charAt(2));
            return;
        }catch(Exception e){
            System.out.println("异常");
        }finally{
            System.out.println("程序结束");
        }
    }
}
